<?php require_once 'header_new.php' ?>
<link rel="stylesheet" href="/static/wapapp/css/complain.css"/>
<body ontouchstart style="-webkit-overflow-scrolling:touch; background: #fff">
<div class="container" id="container" >
</div>
<script type="text/html" id="tpl_home">
<div class="page" >
<div class="nav">
  <img src="/static/wapapp/images/logo.png">
  <div class="nav_btn"><img src="/static/wapapp/images/nav.png"></div>
</div>

<div class="complain_list">

<?php foreach($complain_list as $key=>$item){?>
<div class="complain_box">
  <div class="complain_title">投诉订单：<?php echo $item['report_orderid'];?><div class="comlpain_status comlpain_status_<?php echo $item['report_status'];?> "><?php echo $item['report_status_name'];?></div></div>
  <div class="complain_content">
  <p>投诉原因：<?php echo $item['report_type'];?></p>
  <p>买家留言：<?php echo $item['maijia_remark'];?></p>
  <p>联系方式：<?php echo $item['maijia_telephone'];?></p>
  <p><?php echo $item['report_creattime']?></p>
  </div>
</div>
<?php }?>
</div>
<div class="weui-footer">
            <p class="weui-footer__text">
                ICP备案：<?php echo $this->config['icp'] ?>
            </p>
            <p class="weui-footer__text"><?php echo $this->config['copyright']; ?></p>
</div>
</div>
<script>
var pageIndex=1;
var hav_next=true;
$(function(){
   $(".page").scroll(function(){
	   if( $(".page").scrollTop() + $(".page").height()  >= ($(".complain_list").height()+80)){
          if(hav_next){
			  hav_next=false;
			  pageIndex = pageIndex + 1; 
			  get_list();
         }
      }
   });	
})
function get_list(){
	$.ajax({
	  type: "post",
	  url: "/complain/index",
	  data: {p:pageIndex},
	  async: false,
	  dataType: 'json',
	  success: function (jdata) {
		  var ss='';
		  if(jdata.num>0){
			  $.each(jdata.complain_list,function(index,value){
				  ss+='<div class="complain_box">\
				  <div class="complain_title">投诉订单：'+value.report_orderid+'<div class="comlpain_status comlpain_status_'+value.report_status+'">'+value.report_status_name+'</div></div>\
				  <div class="complain_content">\
				  <p>投诉原因：'+value.report_type+'</p>\
				  <p>买家留言：'+value.maijia_remark+'</p>\
				  <p>联系方式：'+value.maijia_telephone+'</p>\
				  <p>'+value.report_creattime+'</p>\
				  </div>\
				  </div>'
			  });
		  }
		  if(jdata.num==10){
		   hav_next=true;
		  }else{
			ss+='<div class="no_more_data">----------没有更多数据了----------</div>'  
		  }
		  $(".complain_list").append(ss);
	  }
	})
}
</script>
</script>
<?php require_once 'footer_new.php' ?>
